package com.bardsoftware.foronuvolo.server;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;

public abstract class JspHelper {
    static String forward(HttpServletRequest req, HttpServletResponse res, RequestDispatcher dispatcher)
    throws ServletException, IOException {
        BufferHttpResponse response = new BufferHttpResponse(res);
        HttpServletRequestWrapper requestWrapper = new HttpServletRequestWrapper(req);
        dispatcher.forward(requestWrapper, response);
        return response.getResponse();
    }

   public  static String getJspName(String baseName) {
        return ForoNuvoloConstants.FORUM_JSP_PATH + baseName;
    }
}
